<?php 
/*
# ------------------------------------------------------------------------
# JA Teline III - Version 1.3 - Licence Owner jSharing.COM
# ------------------------------------------------------------------------
# Copyright (C) Lifetime Joomla Just for Sharing, Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: Joomla Just for Sharing
# Websites:  http://jsharing.com -  http://jsharing.net
# This file may not be redistributed in whole or significant part.
# ------------------------------------------------------------------------
*/ 
/**
 * JA Bookmark Plugin is a module using for Display icons for your online social networking sites.
 */
// Check to ensure this file is included in Joomla!
defined( '_JEXEC' ) or die(); 
$string = '';
// set configuration.
$string .= '<script type="text/javascript" language="javascript">';
	
	$string .= 'addthis_pub="' . $this->params->get('system-addthis-account', 'joomlart') . '";';
	$string .= 'addthis_header_color="#' . $this->params->get('system-addthis-header_color', '000000') . '";';
	$string .= 'addthis_header_background="#' . $this->params->get('system-addthis-header_background', '999999') . '";';
	$string .= 'addthis_brand="' . $this->params->get('system-addthis-brand_name', 'joomlart.com') . '";';
	// detect language code, check swiching language with joomfish
	$language_code = $this->params->get('or_language_code') != '' 
					? $this->params->get('or_language_code') : $this->params->get('system-addthis-language_code' , 'en');
	// if set auto chang language.
	if( $language_code == 'auto' ) {
		$lg =& JFactory::getLanguage();
		$lang = $lg->get('tag','en-GB');
		$tmp = split('-', $lang);
		$language_code = $tmp[0];
	} 
					
	$string .= 'addthis_language="'.$language_code.'";';
	// if using custom apps socical
	$string .= 'addthis_options="'.$this->params->get('system-addthis-custom_apps').'";';
	// offset position.
	$string .= 'addthis_offset_top="'.$this->params->get('system-addthis-vertical_offset').'";';
	$string .= 'addthis_offset_left="'.$this->params->get('system-addthis-horizontal_offset').'";';
$string .= '</script>';

// image button
if( !$this->params->get('used_custom_button') ){
	 $imgLanguageCode = 'en';
	 if( $this->params->get('system-addthis-button', 'lg-share') != 'sm-plus' ){
		 if( ($this->params->get('system-addthis-button', 'lg-share') == 'lg-share') || ($this->params->get('system-addthis-button', 'lg-share') == 'sm-share')  ){
			$imgLanguageCode = $language_code;
		 }

		 $imageURL = 'http://s7.addthis.com/static/btn/'.$this->params->get('system-addthis-button', 'lg-share').'-'.$imgLanguageCode.'.gif';
	 } else {
		 $imageURL = 'http://s7.addthis.com/static/btn/sm-plus.gif';
	 }
} else {
	$imageURL = $this->params->get('custom_button');
}

$string .= '<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')" onmouseout="addthis_close()" onclick="return addthis_sendto()">';
if( $this->params->get('system-addthis-button') != 'none' ){ 
	$string .= '<img src="'.$imageURL.'"  border="0" alt="" /> ';
}
$string .= $this->params->get('widget_text').' </a><script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>';



echo $string;
?>
